package com.boliq.demo;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

public class MainActivity extends AppCompatActivity {

    private View jumpBtn;
    private TextView jump2RecyclerView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        jumpBtn = findViewById(R.id.tv_jump);
        jumpBtn.setOnClickListener(v -> {
            //设置跳转对象，参数1是上线文对象，参数2是待跳转的目标对象
            Intent intent = new Intent(MainActivity.this, SettingActivity.class);
            startActivity(intent);
        });

        jump2RecyclerView = findViewById(R.id.tv_jump_recycler);
        jump2RecyclerView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                startActivity(new Intent(MainActivity.this,RecyclerViewActivity.class));
            }
        });
    }
}